package com.yangchao.ch05

import groovy.swing.SwingBuilder

import javax.swing.WindowConstants

class example1 {
    public static void main(String[] args) {
        //swing buider构建器,构建gui界面窗口
        swingBuilder()
    }
    static def swingBuilder() {
        def builder = new SwingBuilder()

        def myAPP = builder.frame(title: "我的程序", location: [200, 200], size: [500, 350],
                defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE) {
            //窗体内容
            label(text: "Hello world")
        }
        myAPP.setVisible(true)
    }

}
